﻿using System;

namespace ConsoleApp16
{
    class Program
    {
        static void Main(string[] args)
        {
            
            int count = 0;//计数器
            int sum = 0;//求和
           
            while(true)
            {
                Console.Write("请输入成绩(输入-1结束):");
                int cj = int.Parse(Console.ReadLine());

                    if (cj == -1)
                    {
                         break;
                    }
                    else
                    {
                         sum += cj;
                         count++;
                     }
                Console.WriteLine("平均数为" + sum / count);
            }

            
         

            Console.ReadKey();
        }
    }
}
